1. /* sdmlast.cpp by K.Tsuru */
  2. // function ID = 311 DARDIX, BRADIX
  3. /*****************************************************
  4. SDouble and SDecimal classes
  5. It detectes the position of the last non-zero figure.
  6. When cms=CurrentMaxSize()
  7. p cms L
  8. 0.aaaa bbbb ... cccc 0000 0000 .... xxxx yyyy
  9. it returns "p".
  10. ******************************************************/
  11. #ifndef SN_H
  12. #include "sn.h"
  13. #endif
  14. uint SDouble::GetLastPosition() const{
  15. uint cms = CurrentMaxSize();
  16. if(aHead < cms) return aHead;
  17. uint fsz = figure.size();
  18. cms--;
  19. if(cms > fsz) cms = fsz -1u;
  20. //Maybe there are zeros in the intermediate region.
  21. while( !figure(cms) && (cms > aTail) ) cms--;
  22. return figure(aTail) ? cms : 0;
  23. }

sdmlast.cpp : last modifiled at 2016/09/04 14:21:40(743 bytes)
created at 2017/10/07 10:21:15
The creation time of this html file is 2017/10/07 10:30:03 (Sat Oct 07 10:30:03 2017).